import java.util.Scanner;
import java.util.Arrays;

//对于这道题来说怎么获取输入的数字很重要
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] arr = str.split(" ");
        int[] arr1 = new int[arr.length-1];   //数组最后的下标存放k值
        for(int i = 0; i < arr1.length; i++){
            arr1[i] = Integer.valueOf(arr[i]);
        }
        int k = Integer.valueOf(arr[arr.length-1]);
        Arrays.sort(arr1); //排序
        for(int i = 0; i < k; i++){
            if(i != k-1){
                System.out.print(arr1[i]+" ");
            }else{
                System.out.print(arr1[i]);
            }
        }
        
    }
}
    
    